<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1992-2017 Free Software Foundation, Inc.
Contributed by Cygnus Support.  Written by Julia Menapace, Jim Kingdon,
and David MacKenzie.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled "GNU
Free Documentation License". -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>STABS: Constants</title>

<meta name="description" content="STABS: Constants">
<meta name="keywords" content="STABS: Constants">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Symbol-Types-Index.html#Symbol-Types-Index" rel="index" title="Symbol Types Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Variables.html#Variables" rel="next" title="Variables">
<link href="Alternate-Entry-Points.html#Alternate-Entry-Points" rel="prev" title="Alternate Entry Points">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Constants"></a>
<div class="header">
<p>
Next: <a href="Variables.html#Variables" accesskey="n" rel="next">Variables</a>, Previous: <a href="Program-Structure.html#Program-Structure" accesskey="p" rel="prev">Program Structure</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Constants-1"></a>
<h2 class="chapter">3 Constants</h2>

<p>The &lsquo;<samp>c</samp>&rsquo; symbol descriptor indicates that this stab represents a
constant.  This symbol descriptor is an exception to the general rule
that symbol descriptors are followed by type information.  Instead, it
is followed by &lsquo;<samp>=</samp>&rsquo; and one of the following:
</p>
<dl compact="compact">
<dt><code>b <var>value</var></code></dt>
<dd><p>Boolean constant.  <var>value</var> is a numeric value; I assume it is 0 for
false or 1 for true.
</p>
</dd>
<dt><code>c <var>value</var></code></dt>
<dd><p>Character constant.  <var>value</var> is the numeric value of the constant.
</p>
</dd>
<dt><code>e <var>type-information</var> , <var>value</var></code></dt>
<dd><p>Constant whose value can be represented as integral.
<var>type-information</var> is the type of the constant, as it would appear
after a symbol descriptor (see <a href="String-Field.html#String-Field">String Field</a>).  <var>value</var> is the
numeric value of the constant.  GDB 4.9 does not actually get the right
value if <var>value</var> does not fit in a host <code>int</code>, but it does not
do anything violent, and future debuggers could be extended to accept
integers of any size (whether unsigned or not).  This constant type is
usually documented as being only for enumeration constants, but GDB has
never imposed that restriction; I don&rsquo;t know about other debuggers.
</p>
</dd>
<dt><code>i <var>value</var></code></dt>
<dd><p>Integer constant.  <var>value</var> is the numeric value.  The type is some
sort of generic integer type (for GDB, a host <code>int</code>); to specify
the type explicitly, use &lsquo;<samp>e</samp>&rsquo; instead.
</p>
</dd>
<dt><code>r <var>value</var></code></dt>
<dd><p>Real constant.  <var>value</var> is the real value, which can be &lsquo;<samp>INF</samp>&rsquo;
(optionally preceded by a sign) for infinity, &lsquo;<samp>QNAN</samp>&rsquo; for a quiet
NaN (not-a-number), or &lsquo;<samp>SNAN</samp>&rsquo; for a signalling NaN.  If it is a
normal number the format is that accepted by the C library function
<code>atof</code>.
</p>
</dd>
<dt><code>s <var>string</var></code></dt>
<dd><p>String constant.  <var>string</var> is a string enclosed in either &lsquo;<samp>'</samp>&rsquo;
(in which case &lsquo;<samp>'</samp>&rsquo; characters within the string are represented as
&lsquo;<samp>\'</samp>&rsquo; or &lsquo;<samp>&quot;</samp>&rsquo; (in which case &lsquo;<samp>&quot;</samp>&rsquo; characters within the
string are represented as &lsquo;<samp>\&quot;</samp>&rsquo;).
</p>
</dd>
<dt><code>S <var>type-information</var> , <var>elements</var> , <var>bits</var> , <var>pattern</var></code></dt>
<dd><p>Set constant.  <var>type-information</var> is the type of the constant, as it
would appear after a symbol descriptor (see <a href="String-Field.html#String-Field">String Field</a>).
<var>elements</var> is the number of elements in the set (does this means
how many bits of <var>pattern</var> are actually used, which would be
redundant with the type, or perhaps the number of bits set in
<var>pattern</var>?  I don&rsquo;t get it), <var>bits</var> is the number of bits in the
constant (meaning it specifies the length of <var>pattern</var>, I think),
and <var>pattern</var> is a hexadecimal representation of the set.  AIX
documentation refers to a limit of 32 bytes, but I see no reason why
this limit should exist.  This form could probably be used for arbitrary
constants, not just sets; the only catch is that <var>pattern</var> should be
understood to be target, not host, byte order and format.
</p></dd>
</dl>

<p>The boolean, character, string, and set constants are not supported by
GDB 4.9, but it ignores them.  GDB 4.8 and earlier gave an error
message and refused to read symbols from the file containing the
constants.
</p>
<p>The above information is followed by &lsquo;<samp>;</samp>&rsquo;.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Variables.html#Variables" accesskey="n" rel="next">Variables</a>, Previous: <a href="Program-Structure.html#Program-Structure" accesskey="p" rel="prev">Program Structure</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
